package com.rxmvp.baselibrary.rxretrofit.response;


import com.rxmvp.baselibrary.App;
import com.rxmvp.baselibrary.rxretrofit.ErrorCode;
import com.rxmvp.baselibrary.utils.ToastUtil;

/**
 * 作者： huangRZ on 2017/1/21. 15:04
 * 邮箱：917647409@qq.com
 */
public class ResponseUtil {
    public static boolean IsNormal(BaseResponse response) {
        if (response == null) {
//            ToastUtil.toastShort(MyApplication.getContext(), R.string.ser_error);
            return false;
        }
        if (response.getCode() == 0) {
            return true;
        } else {
            ToastUtil.toastLong(App.getApp(), ErrorCode.getInstance().get(response.getCode()));
            return false;
        }
    }
}
